package com.ls.resourceloader;

import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.DefaultResourceLoader;

public class ResourceLoaderApplication {
	public static void main(String[] args) throws Exception {
		DefaultResourceLoader defaultResourceLoader = new DefaultResourceLoader();
		ClassPathResource  resource = (ClassPathResource)defaultResourceLoader.getResource("classpath:Application.xml");
		//文件是否存在
		System.out.println(resource.exists());
		//获取类加载器
		System.out.println(resource.getClass());

	}
}
